<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>简介</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="book.luasandbox.html">« LuaSandbox</a></li>
      <li style="float: right;"><a href="luasandbox.setup.html">安装/配置 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.luasandbox.html">LuaSandbox</a></li>
    <li>简介</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="intro.luasandbox" class="preface">
  <h1 class="title">简介</h1>
  <p class="para">
   LuaSandbox is an extension for PHP 7 and PHP 8 to allow safely
   running untrusted Lua 5.1 code from within PHP.
  </p>
  <p class="para">
   Differences compared to the <a href="book.lua.html" class="link">Lua</a> extension:
   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      LuaSandbox has support for time and memory limits.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      LuaSandbox provides a default-safe environment for running untrusted code.
      Stock Lua functions were reviewed for security, and several were patched
      accordingly.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      LuaSandbox has a PHP interface which is more complex, precise and powerful,
      but it is less convenient for developers.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      LuaSandbox supports only Lua 5.1. It is difficult to change this, because
      LuaSandbox uses heavily modified Lua standard libraries, and
      due to the lack of backwards compatibility between major Lua versions.
      LuaSandbox aims to maximise backwards compatibility with user-supplied
      scripts.
     </p>
    </li>
   </ul>
  </p>
 </div></div></div></body></html>